using System.Collections.Generic;

namespace OracleInternal.SqlAndPlsqlParser.RuleProcessors
{
	internal class OracleMbParserPropertiesBag
	{
		private const string c_strDoubleQuotes = "\"";

		private static readonly char[] c_strDoubleQuotesCharArr = new char[1]
		{
			'"'
		};

		protected string m_vName;

		protected string m_vOwner;

		protected Dictionary<string, object> m_vPropertiesBag = new Dictionary<string, object>();

		protected string m_vDefaultSchemaName;

		public string Name
		{
			get
			{
				return m_vName;
			}
			set
			{
				m_vName = value;
			}
		}

		public string Owner
		{
			get
			{
				return m_vOwner;
			}
			set
			{
				m_vOwner = value;
			}
		}

		public Dictionary<string, object> Properties => m_vPropertiesBag;

		public string DefaultSchemaName
		{
			get
			{
				if (string.IsNullOrEmpty(m_vDefaultSchemaName))
				{
					m_vDefaultSchemaName = "DefaultSchema";
				}
				return m_vDefaultSchemaName;
			}
			set
			{
				m_vDefaultSchemaName = value;
			}
		}

		internal void RemoveKeyFromProperties(string key)
		{
			if (!string.IsNullOrEmpty(key) && Properties.ContainsKey(key))
			{
				Properties.Remove(key);
			}
		}

		public virtual void Clear()
		{
			m_vPropertiesBag.Clear();
			m_vName = null;
			m_vOwner = null;
			m_vDefaultSchemaName = "DefaultSchema";
		}
	}
}
